// pages/duchuntao/unit2/case2-12/case2-12.js
var rand,sum;
function createRand(){  
    rand=[];  
    sum=0;  
    for(var i=0;i<6;i++){    
        var r=(Math.random()*100).toFixed(2)*1;    
        rand.push(r);    
        sum+=rand[i];    
        console.log(rand[i])  }  
        console.log(sum);}
        Page({  
            onLoad:function(){    
                createRand();    
                this.setData({      
                    rand:rand,      
                    sum:sum    
                })  
            },  
            newrand:function(){    
                createRand();    
                this.setData({      
                    rand:rand,      
                    sum:sum    
                })  
            }
        })
